{% extends "admin/change_form.html" %}
{% load static %}
{% block admin_change_form_document_ready %}
  {{ block.super }}
  <script>
      (function ($) {
          $('#id_sd').on('click', function (){
              if($('#id_sd').prop('checked') == true) {
                  $('#id_sd_volume_max').prop('readonly', false)
                  $('#id_sd_volume_max').val('')
                  $('#id_sd_volume_max').css('background', 'white')
              } else {
                  $('#id_sd_volume_max').prop('readonly', true)
                  $('#id_sd_volume_max').val('')
                  $('#id_sd_volume_max').css('background', 'lightgray')
              }
          })
      })(django.jQuery);
  </script>

{% endblock %}